<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>${menuDetail.name}</title>
<#include "/admin/main/include/link_head.ftl"/>
</head>

<body class="jr-body">
<div class="jr-main-content">
<@tags.pageHeading />
    <div class="wrapper">
        <div class="row">
            <div class="col-md-12">
            <@tags.table id="easyui-datagrid-left" options="url:'page',singleSelect:true,pagination:false">
                <@tags.th options="field:'id',sortable:false,align:'center'"><@spring.message '流程ID' /></@tags.th>
                <@tags.th options="field:'name',sortable:false,width:200"><@spring.message '流程名称' /></@tags.th>
                <@tags.th options="field:'key',sortable:false,width:150"><@spring.message '流程KEY值' /></@tags.th>
                <@tags.th options="field:'version',sortable:false,align:'center'"><@spring.message '版本' /></@tags.th>
                <@tags.th options="field:'createTime',sortable:false,align:'center',width:150"><@spring.message '创建时间' /></@tags.th>
                <@tags.th options="field:'lastUpdateTime',sortable:false,align:'center',width:150"><@spring.message '最后修改时间' /></@tags.th>
                <@tags.th options="field:'op',sortable:false,align:'center',formatter:'uiOp',width:200"><@spring.message '操作' /></@tags.th>
            </@tags.table>
            <@tags.gridBtns id="tbMain" btns="add,remove,export" />
            </div>
        </div>
    </div>
</div>
</body>
</html>
<#include "/admin/main/include/link_foot.ftl"/>
<script type="text/javascript">
    function uiOp(value, row, index) {
        var htm = '<button class="btn btn-primary btn-sm" type="button" onclick="doV(\'' + row.id + '\')"><@spring.message '可视化' /></button>';
        htm += '&nbsp;<button class="btn btn-primary btn-sm" type="button" onclick="doExport(\'' + row.id + '\')"><@spring.message '导出' /></button>';
        htm += '&nbsp;<button class="btn btn-primary btn-sm" type="button" onclick="doDeploy(\'' + row.id + '\')"><@spring.message '部署' /></button>';
        return htm;
    }
    function doV(id) {
        window.open("modeler?modelId=" + id);
    }
    function doExport(id) {
        window.open("export?modelId=" + id + "&type=bpmn");
    }
    function doDeploy(id) {
        $.post("deploy", {
            modelId: id
        }, function () {
            alert("<@spring.message '部署成功' />");
        });
    }
</script>